<template>
  <div>
    <div class="navbox">
      <ul>
        <li v-for="(v, i) in fenleiData" :key="i" @click="fun(v.url)">
          <p><img :src="v.imgUrl" /></p>
          <p class="toptex">{{ v.title }}</p>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
export default {
  props: ["fenleiData"],
  methods: {
    fun(url) {
      // 编程式方式进行----路由跳转
      this.$router.push(url);
    },
  },
};
</script>

<style lang="less" scoped>
.navbox {
  width: 95%;
  height: auto;
  background-color: #fff;
  margin: auto;
}
ul {
  display: flex;
  flex-wrap: wrap;
  height: 100%;

  li {
    width: 20%;
    text-align: center;
    font-size: 0.14rem;
    align-items: center;
    margin-top: 0.1rem;
    margin-bottom: 0.1rem;

    p {
      span {
        font-size: 0.3rem;
      }
    }
  }
}
.toptex {
  margin-top: 0.0067rem;
}
img {
  width: 0.36rem;
}
</style>